home *** CD-ROM | disk | FTP | other *** search
/ SuperHack / SuperHack CD.bin / CODING / VBASIC / DISKEYS.ZIP / MAIN.FRM (.txt) < prev   
Encoding:
Visual Basic Form  |  1996-10-24  |  2.2 KB  |  67 lines

  1. VERSION 4.00
  2. Begin VB.Form Form1 
  3.    Caption         =   "How to disable multitasking keys, by Alesh Mustar"
  4.    ClientHeight    =   3105
  5.    ClientLeft      =   4200
  6.    ClientTop       =   4815
  7.    ClientWidth     =   6690
  8.    Height          =   3510
  9.    Left            =   4140
  10.    LinkTopic       =   "Form1"
  11.    ScaleHeight     =   3105
  12.    ScaleWidth      =   6690
  13.    Top             =   4470
  14.    Width           =   6810
  15.    Begin VB.CommandButton Command2 
  16.       Caption         =   "Enable Multitasking keys"
  17.       Height          =   1035
  18.       Left            =   3660
  19.       TabIndex        =   1
  20.       Top             =   1230
  21.       Width           =   2475
  22.    End
  23.    Begin VB.CommandButton Command1 
  24.       Caption         =   "Disable Multitasking keys"
  25.       Height          =   1005
  26.       Left            =   690
  27.       TabIndex        =   0
  28.       Top             =   1230
  29.       Width           =   2175
  30.    End
  31.    Begin VB.Label Label1 
  32.       Height          =   255
  33.       Left            =   2580
  34.       TabIndex        =   2
  35.       Top             =   690
  36.       Width           =   1455
  37.    End
  38. Attribute VB_Name = "Form1"
  39. Attribute VB_Creatable = False
  40. Attribute VB_Exposed = False
  41. Private Declare Function SystemParametersInfo Lib "user32" _
  42.    Alias "SystemParametersInfoA" (ByVal uAction As Long, _
  43.    ByVal uParam As Long, lpvParam As Any, _
  44.    ByVal fuWinIni As Long) As Long
  45.    Private Const SPI_SCREENSAVERRUNNING = 97
  46.    Private Sub Command1_Click()
  47.      'lets enable the keys back
  48.      Dim ret As Integer
  49.      Dim pOld As Boolean
  50.      ret = SystemParametersInfo(SPI_SCREENSAVERRUNNING, True, pOld, 0)
  51.      Label1.Caption = "Keys Disabled"
  52.    End Sub
  53.    Private Sub Command2_Click()
  54.      'lets call the API call, which is used in the screen saver also
  55.      Dim ret As Integer
  56.      Dim pOld As Boolean
  57.      ret = SystemParametersInfo(SPI_SCREENSAVERRUNNING, False, pOld, 0)
  58.      Label1.Caption = "Keys Enabled"
  59.    End Sub
  60. Private Sub Form_Load()
  61. Label1.Caption = "Keys Enabled"
  62. End Sub
  63.    Private Sub Form_Unload(Cancel As Integer)
  64.    're-enable Ctrl+Alt+Del and Alt+Tab before the program terminates
  65.      Command2_Click
  66.    End Sub
  67.